package com.example.service;

import com.example.entity.CommonReqDTO;
import com.example.mapper.DynamicSqlMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class TemplateDataServiceImpl implements DataService {

    @Autowired
    private DynamicSqlMapper dynamicSqlMapper;

    @Override
    public List<Map<String, Object>> getData(String sql) {
        // 直接使用预存的SQL ID执行查询
        return dynamicSqlMapper.executeRawSql(sql);
    }

    @Override
    public List<Map<String, Object>> getData(Integer id) {
        return dynamicSqlMapper.executeRawSql2(id);
    }

    @Override
    public List<Map<String, Object>> getData(Map<String, Object> map) {
        return dynamicSqlMapper.executeSqlByMap(map);
    }

}
